package yx.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * BsTree entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "bs_tree", catalog = "")
public class BsTree implements java.io.Serializable {

	// Fields

	private Integer id;
	private BsTree bsTree;
	private String text;
	private String type;
	private String url;
	private Integer seq;
	private String iconCls;
	private Set<BsTree> bsTrees = new HashSet<BsTree>(0);

	// Constructors

	/** default constructor */
	public BsTree() {
	}

	/** full constructor */
	public BsTree(BsTree bsTree, String text, String type, String url, Integer seq, String iconCls, Set<BsTree> bsTrees) {
		this.bsTree = bsTree;
		this.text = text;
		this.type = type;
		this.url = url;
		this.seq = seq;
		this.iconCls = iconCls;
		this.bsTrees = bsTrees;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PID")
	public BsTree getBsTree() {
		return this.bsTree;
	}

	public void setBsTree(BsTree bsTree) {
		this.bsTree = bsTree;
	}

	@Column(name = "TEXT", length = 32)
	public String getText() {
		return this.text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Column(name = "TYPE", length = 2)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "URL", length = 100)
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "SEQ")
	public Integer getSeq() {
		return this.seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	@Column(name = "ICON_CLS", length = 100)
	public String getIconCls() {
		return this.iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bsTree")
	public Set<BsTree> getBsTrees() {
		return this.bsTrees;
	}

	public void setBsTrees(Set<BsTree> bsTrees) {
		this.bsTrees = bsTrees;
	}

}